<template>
	<div class="pages">

        <van-nav-bar title="系统设置" left-arrow fixed safe-area-inset-top @click-left="onClickLeft"></van-nav-bar>

		<div class="info">
			<div class="info-title">基础信息</div>
            <div class="info-flex">
				<div class="info-name">版本号</div>
				<div class="info-des">
					<div class="des-txt">1.0.0</div>
                    <img class="des-icon" src="https://files.onestep6.com/cloud/order-right.png" />
				</div>
			</div>
            <div class="info-flex" @click="()=>{ $router.push('/agreement') }">
				<div class="info-name">用户协议</div>
				<div class="info-des">
                    <img class="des-icon" src="https://files.onestep6.com/cloud/order-right.png" />
				</div>
			</div>
            <div class="info-flex info-no" @click="()=>{ $router.push('/privacy') }">
				<div class="info-name">隐私政策</div>
				<div class="info-des">
                    <img class="des-icon" src="https://files.onestep6.com/cloud/order-right.png" />
				</div>
			</div>
		</div>

		<!-- 底部按钮 -->
		<div class="content-bottom">
			<van-button class="bottom-ask" @click="onOutLogin">退出登录</van-button>
		</div>

        <popup-choose ref="popupChoose" txt="确定要退出当前账号吗？" @right="onRight" />
	</div>
</template>

<script>
    import popupChoose from "@/components/popupChoose.vue";
	export default {
        components: {
			popupChoose
		},
		data() {
			return {
				shop: {
					shop_pic: 'https://files.hzahp.com/imgs/175746838577807.webp',
					shop_name: '',
				},
				userInfo: {
                    phone: '13297909015'
                }
			}
		},
		methods: {
			onClickLeft() {
                this.$router.back();
            },
            onOutLogin() {
                this.$refs.popupChoose.show()
            },
            onRight() {
				// 清空所有 localStorage 数据
				localStorage.clear();
				this.$router.replace('/login')
            }
		}
	}
</script>

<style lang="less" scoped>
.pages{
	padding-top: calc(92px + 38px);
    min-height: 100vh;
    background: #F6F6F6;
    ::v-deep .van-nav-bar .van-icon {
        color: #323233;
    }
    ::v-deep .van-nav-bar{
        background: transparent;
    }
    ::v-deep .van-hairline--bottom::after {
        border: none;
    }
}
.info{
	width: 670px;
	padding: 30px 36px 0;
	background: #FFFFFF;
	border-radius: 16px;
	margin: 0 auto;
	.info-title{
		font-size: 28px;
		line-height: 34px;
		font-weight: 500;
        margin-bottom: 10px;
	}
	.info-flex{
		display: flex;
		justify-content: space-between;
		align-items: center;
		width: 598px;
		height: 78px;
		border-bottom: 2px solid #F5F5F6;
	}
    .info-no{
        border: none;
    }
	.info-name{
		font-size: 28px;
		line-height: 34px;
		font-weight: 400; 
	}
	.info-des{
		display: flex;
		align-items: center;
		::v-deep .uni-easyinput__content-input{
			width: 390px;
			text-align: right;
			font-size: 24px;
			line-height: 76px;
			color: #798391;
		}
	}
	.des-txt{
		font-size: 24px;
		line-height: 76px;
		color: #798391;
		font-weight: 400;
		margin-right: 16px;
	}
	.des-img{
		display: block;
		width: 48px;
		height: 48px;
		border-radius: 50%;
		background: #D9D9D9;
	}
	.des-icon{
		display: block;
		width: 24px;
		height: 24px;
	}
}

.content-bottom{
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100vw;
    padding-top: 19px;
	padding-left: 56px;
	padding-right: 56px;
    padding-bottom: calc(20px + constant(safe-area-inset-bottom)); /* 兼容 iOS<11.2 */
    padding-bottom: calc(20px + env(safe-area-inset-bottom)); /* 兼容iOS>= 11.2 */
    background: #FFFFFF;
	.bottom-flex{
        display: flex;
        justify-content: space-between;
    }
	.bottom-ask{
        width: 638px;
        height: 80px;
        background: #49CA6F;
        font-size: 32px;
        color: #FFFFFF;
        font-weight: bold;
        border-radius: 39px;
        line-height: 80px;
        margin: 0;
        margin-left: 9px;
        border: none;
    }
}
</style>
